import { createRouter, createWebHistory } from "vue-router"
import Layout from '@/layout/index.vue'
import discover from "./modules/discover"
import user from './modules/user'

import artist from './modules/artist.js'


/**
* @author: 羽
* @params:
* @desc: meta
 *        -title 作为导航
 *        -hidden 是否隐藏导航
 *        -submenu 是否存在二级菜单
 *        -mobileNo 针对移动端不显示菜单
* @date: 2022/7/26
*/
export const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/discover',
    children: [
      discover(),
      {
        path: '/myMusic',
        name: 'MyMusic',
        meta: { title: '我的音乐', hidden: true, submenu: false },
        redirect: '/myMusic/artist',
        component: () => import('@/views/MyMusic/index.vue'),
        children: [
          {
            path: 'artist',
            name: 'MyMusicArtist',
            meta: {title: '我的歌手', hidden: true, submenu: false},
            component: () => import('@/views/MyMusic/components/MyMusicArtist/index.vue'),
          },
          {
            path: 'mv',
            name: 'MyMusicMv',
            meta: {title: '我的视频', hidden: true, submenu: false},
            component: () => import('@/views/MyMusic/components/MyMusicMv/index.vue'),
          },
          {
            path: 'djRadio',
            name: 'MyMusicDjRadio',
            meta: {title: '我的电台', hidden: true, submenu: false},
            component: () => import('@/views/MyMusic/components/MyMusicDjRadio/index.vue'),
          },
          {
            path: 'createdPlaylist',
            name: 'MyMusicCreatedPlaylist',
            meta: {title: '创建的歌单', hidden: true, submenu: false},
            component: () => import('@/views/MyMusic/components/MyMusicCreatedPlaylist/index.vue'),
          },
          {
            path: 'edit',
            name: 'PlaylistEdit',
            meta: {title: '编辑歌单信息', hidden: true, submenu: false},
            component: () => import('@/views/MyMusic/components/PlaylistEdit/index.vue'),
          }
        ]
      },
      {
        path: '/attention',
        meta: { title: '我的关注', hidden: true, submenu: false },
        name: 'Attention',
        component: () => import('@/views/Attention/index.vue')
      },
      {
        path: '/shop',
        meta: { title: '商城', hidden: true, submenu: false },
        name: 'Shop',
        component: () => import('@/views/RecommendMusic/index.vue') // 需要换
      },
      {
        path: '/mv',
        meta: { title: 'mv', hidden: false, submenu: false, mobileNo: true },
        name: 'MV',
        component: () => import('@/views/Mv/index.vue') // 需要换
      },
      {
        path: '/musician',
        meta: { title: '音乐人', hidden: true, submenu: false },
        name: 'Musician',
        component: () => import('@/views/RecommendMusic/index.vue')// 需要换
      },
      {
        path: '/download',
        meta: { title: '下载客户端', hidden: true, submenu: false, mobileNo: true },
        name: 'Download',
        component: () => import('@/views/RecommendMusic/index.vue')// 需要换
      },
      user(),
      {
        path: '/play-list-detail',
        meta: { title: '歌单详情', hidden: false, submenu: false, mobileNo: true },
        name: 'PlayListDetail',
        component: () => import('@/views/PlayListDetail/index.vue')
      },
      {
        path: '/collection-detail',
        meta: { title: '专辑详情', hidden: false, submenu: false, mobileNo: true },
        name: 'CollectionDetail',
        component: () => import('@/views/PlayListDetail/index.vue')
      },
      {
        path: '/dj-radio',
        meta: { title: '电台详情', hidden: false, submenu: false, mobileNo: true },
        name: 'DjRadio',
        component: () => import('@/views/PlayListDetail/index.vue')
      },
      {
        path: '/radio-program',
        meta: { title: '电台节目详情', hidden: false, submenu: false, mobileNo: true },
        name: 'RadioProgram',
        component: () => import('@/views/PlayListDetail/index.vue')
      },
      {
        path: '/pc-song-detail',
        meta: { title: 'pc歌曲详情', hidden: false, submenu: false, mobileNo: true },
        name: 'PcSongDetail',
        component: () => import('@/views/PlayListDetail/index.vue')
      },
      {
        path: '/everyday-playlist',
        meta: { title: '每日推荐', hidden: false, submenu: false, mobileNo: true },
        name: 'EveryDayPlaylist',
        component: () => import('@/views/EveryDayPlaylist/index.vue')
      },
      {
        path: 'mobile-details-song',
        name: 'MobileDetailsSong',
        meta: {title: '移动端歌曲详情', mobileHidden: true, mobileNo: true },
        component: () => import('@/views/MobileDetailsSong/index.vue'),
      },
      artist()
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
